package com.xuecheng.auth.controller;

import com.xuecheng.service.FindPasswordService;
import com.xuecheng.ucenter.model.dto.FindPasswordDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

/**
 * @author 陈竞超
 * @version 1.0
 * @qq 2250537249
 */
@Slf4j
@RestController
public class FindController {
    @Autowired
    FindPasswordService findPasswordService;
    @PostMapping("/findpassword")
    public String findPassword(@RequestBody FindPasswordDto findPasswordDto){
        FindPasswordDto byPhone = findPasswordService.ByPhone(findPasswordDto);
        if (byPhone!=null){
            return "http://www.51xuecheng.cn/sign.html";
        }
        return "redirect:http://www.51xuecheng.cn/error.html";
    }

}
